package com.ry.novel.controller;

import com.ry.novel.model.dto.CategoryInfo;
import com.ry.novel.model.resp.Result;
import com.ry.novel.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ry
 * @since 2022-02-18 08:19
 **/
@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;


    @GetMapping("/getAllCategory")
    public Result<List<CategoryInfo>> getAllCategory(){
        return Result.ok(categoryService.getAllCategory());
    }
}
